#include "error.h"

void handle_error(char *e) {
	printf("ERROR");
	printf(": %s\n", e);
}

void breakpoint_function() {
	int i=0;
	i++;
	printf("d\n");
	return;
}

void printf_error() {
	char buffer[ERROR_MESSAGE_LEN];
	char *merror = strerror_r(errno, buffer, ERROR_MESSAGE_LEN);
	if(merror == 0) {
		handle_error("strerror_r error\n");
	}
	printf("%s\n", merror);
	if(strcmp("Socket operation on non-socket", merror)==0) {
		//printf_nodecache();
		breakpoint_function();
		exit(1);
	}
}
